//
//  AppDelegate+UpdateVersion.m
//  HaiYue
//
//  Created by skyline on 2018/1/11.
//  Copyright © 2018年 skyline. All rights reserved.
//

#import "AppDelegate+UpdateVersion.h"

@implementation AppDelegate (UpdateVersion)
+ (instancetype)shareAppDelegate
{
    return (AppDelegate *)[[UIApplication sharedApplication] delegate];
}

+ (void)openAPP:(NSString *)url
{
#ifdef iOS10Later
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url] options:@{} completionHandler:nil];
#else
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
#endif
}

+ (void)openQQ
{
    if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"mqq://"]])
    {
        //跳转群
        //                    [AppDelegate  openAPP:@"mqqapi://card/show_pslcard?src_type=internal&version=1&uin=196162819&card_type=group"];
        //跳转qq
        [AppDelegate  openAPP:@"mqq://im/chat?chat_type=wpa&uin=290255613&version=1&src_type=web"];
    }
    else
    {
        [CCAlert showMessage:@"未安装QQ,请前往安装" title:@"" enter:^{
            [AppDelegate  openAPP:@"itms-apps://App.apple.com"];
        }];
    }
}
@end
